package com.topcheer.provider.common.config;

import com.topcheer.common.base.cache.CacheAdvisor;
import com.topcheer.common.base.cache.CacheInterceptor;
import com.topcheer.common.base.util.SimpleAntPathMatcher;
import com.topcheer.common.base.util.SpringContextUtils;
import org.springframework.aop.support.AbstractPointcutAdvisor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author xutao
 * @Package com.topcheer.provider.common.config
 * @Description: ${todo}
 * @date 2020/4/7 15:49
 */
@Configuration
public class ExteralConfig {

    @Bean
    SpringContextUtils springContextUtils(){
        return new SpringContextUtils();
    }
    @Bean
    SimpleAntPathMatcher simpleAntPathMatcher(){
        return new SimpleAntPathMatcher();
    }

    @Bean
    public AbstractPointcutAdvisor defaultPointcutAdvisor3() {
        return new CacheAdvisor(cacheInterceptor());
    }

    @Bean
    CacheInterceptor cacheInterceptor(){
        return new CacheInterceptor();
    }
}
